package com.zy.dp.template.example3;

public class NormalLogin extends LoginTemplate
{

	@Override
	public LoginModel findLoginUser(String loginId)
	{

		NormalLoginModel nlm = new NormalLoginModel();
		nlm.setLoginId(loginId);
		nlm.setPwd("testpwd");
		nlm.setQuestion("testQuestion");
		nlm.setAnswer("testAnswer");

		return nlm;

	}

	@Override
	public boolean match(LoginModel lm, LoginModel dblm)
	{

		boolean f1 = super.match(lm, dblm);

		if (f1)
		{

			NormalLoginModel nlm = (NormalLoginModel) lm;
			NormalLoginModel dbnlm = (NormalLoginModel) dblm;

			if (dbnlm.getQuestion().equals(nlm.getQuestion())
					&& dbnlm.getAnswer().equals(nlm.getAnswer()))
			{
				return true;
			}

		}
		return false;
	}

}
